package com.twu.biblioteca;


public class Authenticator {
    private User user;
    private Login login;

    public Authenticator(User user, Login login) {
        this.user = user;
        this.login = login;
    }

    public boolean isLoggedIn() {
        return (user != null) ;
    }

    public int getCurrentUserLibraryNumber() {
        return user.getLibraryNumber();
    }

    public void assureLogin() {
        while (!isLoggedIn()) {
            user = login.checkLogin();
        }
    }

    public String getUserInformation(){
        String currentUser = user.getUserInformation();
        return currentUser;
    }
}
